<?php
/*
Primary Author: Derek Shue
Secondary: Alex Arey
Documentation: Cheng Yi
Updated: 12/10/2011
Module Description: The Administrators module adds/finds/deletes Administrators from the database.
*/
class Application_Model_DbTable_Administrators extends Zend_Db_Table_Abstract
{

    protected $_name = 'ADMINISTRATORS';



public function getAdministrator($id)
    {
        $id = (int)$id;
        $row = $this->fetchRow('ID = ' . $id);
        if (!$row) {
            throw new Exception("Could not find row $id");
        }
        return $row->toArray();
    }

    public function addAdministrator($adminlevel, $firstname, $lastname, $email, $phone, $title)
    {
        $data = array(
            'ID' => $id,
            'ADMINLEVEL' => $adminlevel,
'FIRSTNAME' => $firstname,
'LASTNAME' => $lastname,
'EMAIL' => $email,
'PHONE' => $phone,
'TITLE' => $title,



        );
        $this->insert($data);
    }

    public function updateAdministrator($id, $adminlevel, $firstname, $lastname, $email, $phone, $title)
    {
        $data = array(
            'ID' => $id,
            'ADMINLEVEL' => $adminlevel,
'FIRSTNAME' => $firstname,
'LASTNAME' => $lastname,
'EMAIL' => $email,
'PHONE' => $phone,
'TITLE' => $title,

        );
        $this->update($data, 'ID = '. (int)$id);
    }

    public function deleteAdministrator($id)
    {
        $this->delete('ID =' . (int)$id);
    }

/*
IDNUMBER
ADMINLEVELNUMBER
FIRSTNAMEVARCHAR2
LASTNAMEVARCHAR2
EMAILVARCHAR2
PHONEVARCHAR2
TITLEVARCHAR2
*/

}



































































































































